import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '登录 - 危运运 '
    },
    component: () => import('@/views/login.vue')
};

// 大屏
export const dataRouter = {
    path: '/data',
    name: 'data',
    meta: {
        title: '大屏数据 '
    },
    component: () => import('@/views/home/data.vue')
};

export const registRouter = {
    path: '/regist',
    name: 'regist',
    meta: {
        title: '注册 - 危运运'
    },
    component: () => import('@/views/regist.vue')
};

export const registResult = {
    path: '/regist-result',
    name: 'regist-result',
    meta: {
        title: '注册结果 - 危运运'
    },
    component: () => import('@/views/regist-result.vue')
};

export const reset = {
    path: '/reset',
    name: 'reset',
    meta: {
        title: '重置密码 - 危运运'
    },
    component: () => import('@/views/reset.vue')
};

export const relateRouter = {
    path: '/relate',
    name: 'relate',
    meta: {
        title: '绑定账号 - 危运运 '
    },
    component: () => import('@/views/relate.vue')
};

export const authorizeRouter = {
    path: '/authorize',
    name: 'authorize',
    meta: {
        title: '认证平台 - 危运运 '
    },
    component: () => import('@/views/authorize.vue')
};

// export const page404 = {
//     path: '/*',
//     name: 'error-404',
//     meta: {
//         title: '404-页面不存在'
//     },
//     component: () => import('@/views/error-page/404.vue')
// };

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () => import('@/views/error-page/403.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () => import('@/views/error-page/500.vue')
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () => import('@/views/main-components/lockscreen/components/locking-page.vue')
};


// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: Main,
    children: [
        { path: 'home', title: { i18n: 'home' }, name: 'home_index', component: () => import('@/views/home/home.vue') },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: () => import('@/views/own-space/own-space.vue') },
        { path: 'change-pass', title: '修改密码', name: 'change_pass', component: () => import('@/views/change-pass/change-pass.vue') },
        { path: 'message', title: '消息中心', name: 'message_index', component: () => import('@/views/message/message.vue') },
        { path: 'ConsultDetails', title: '咨询投诉详情', name: 'ConsultDetails', component: () => import('@/views/message/message-kefu/ConsultDetails.vue') },
        { path: 'ContractR', title: '合同规则', name: 'ContractR', component: () => import('@/views/ContractR.vue') },
        { path: 'addModal', title: '发布货源', name: 'addModal', component: () => import('@/views/appoint/appoint-goods/component/addModal.vue') },
        { path: 'editModal', title: '编辑货源', name: 'editModal', component: () => import('@/views/appoint/appoint-goods/component/editModal.vue') },
        { path: 'detailsModal', title: '货源详情', name: 'detailsModal', component: () => import('@/views/appoint/appoint-goods/component/detailsModal.vue') },
        { path: 'OneMoreOrder', title: '再来一单', name: 'OneMoreOrder', component: () => import('@/views/appoint/appoint-goods/component/OneMoreOrder.vue') },
        { path: 'detailScarryWaybill', title: '运单详情', name: 'detailScarryWaybill', component: () => import('@/views/order/order-carryWaybill/detailScarryWaybill.vue') },
        { path: 'goods-map', title: '调度配载', name: 'goods-map', component: () => import('@/views/appoint/appoint-goods/goods-map.vue') },
        // 货主端 OwnerEnd

        { path: 'platformManual', title: '手册', name: 'platformManual', component: () => import('@/views/platformManual.vue') },

        { path: 'addGoods', title: '发布货源', name: 'addGoods', component: () => import('@/views/ownerManagement/supply-damin/goods-admin/addGoods.vue') },
        { path: 'detailsGoods', title: '货源详情', name: 'detailsGoods', component: () => import('@/views/ownerManagement/supply-damin/goods-admin/detailsGoods.vue') },
        { path: 'editGoods', title: '编辑货源', name: 'editGoods', component: () => import('@/views/ownerManagement/supply-damin/goods-admin/editGoods.vue') },
        { path: 'oneMoreOrderOwner', title: '再来一单', name: 'oneMoreOrderOwner', component: () => import('@/views/ownerManagement/supply-damin/goods-admin/oneMoreOrder.vue') },
        { path: 'orderLsit', title: '货源详情', name: 'orderLsit', component: () => import('@/views/ownerManagement/supply-damin/order-admin/orderDetails.vue') },
        { path: 'consultComplaintDetails', title: '咨询投诉详情', name: 'consultComplaintDetails', component: () => import('@/views/ownerManagement/personal-center/consultComplaintDetails.vue') },
        { path: 'ownerDetailScarryWaybill', title: '运单详情', name: 'ownerDetailScarryWaybill', component: () => import('@/views/ownerManagement/waybill-admin/detailScarryWaybill.vue') },
        { path: 'dispatchConsignor', title: '调度配载', name: 'dispatchConsignor', component: () => import('@/views/ownerManagement/supply-damin/goods-admin/dispatchConsignor.vue') },

    ]
};
export const appRouter = [];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    dataRouter,
    loginRouter,
    registRouter,
    registResult,
    reset,
    relateRouter,
    authorizeRouter,
    otherRouter,
    locking,
    ...appRouter,
    page500,
    page403
];
